using SM.core;
using SS;
using System;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Windows.Forms;
using TVSGPP.func;
namespace TVSBH.func
{
	public class frmActPricePublic : Form
	{
		private Func objFunc = new Func();
		private DataTable objTable;
		private DataTable objTableBarcode = new DataTable();
		private Bill objBill = new Bill();
		private string sqlCon = "";
		public string userName = "";
		public string fullName = "";
		private bool isPostBack = false;
		private int currGroup = 0;
		private IContainer components = null;
		private DataGridView dgvProduct;
		private Button btnClose;
		private GroupBox groupBox1;
		private ComboBox cbbParentGID;
		private Label label1;
		private Button btnCreate;
		private Button btnEdit;
		private TextBox txtSearch;
		private Label label3;
		private DataGridView dgvRep;
		private DataGridViewTextBoxColumn dg2;
		private DataGridViewTextBoxColumn dg6;
		private DataGridViewTextBoxColumn Column2;
		private DataGridViewTextBoxColumn Column1;
		private DataGridViewTextBoxColumn Column9;
		private DataGridViewTextBoxColumn Column4;
		private DataGridViewTextBoxColumn Column5;
		private DataGridViewTextBoxColumn Column6;
		private DataGridViewTextBoxColumn Column3;
		private Label label4;
		private ComboBox cbbWareHouse;
		private CheckBox ckbProduct;
		private Button btnConfig;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn2;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn3;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn4;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn5;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn6;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn7;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn8;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn9;
		private Label label2;
		private Label label5;
		public frmActPricePublic()
		{
			this.InitializeComponent();
			this.sqlCon = this.objFunc.strConnectionString;
		}
		private void frmInput_Load(object sender, EventArgs e)
		{
			this.objFunc.LoadComboBoxStock("SELECT WareHouse_ID, UPPER(WareHouse_Name) AS Name FROM TabWareHouse ORDER BY WareHouse_Name", this.cbbWareHouse, "WareHouse_ID", "Name");
			this.objFunc.LoadComboBoxGProduct("SELECT GpID, GpName FROM TabGproducts ORDER BY GpName", this.cbbParentGID, "GpID", "GpName");
			this.cbbParentGID.SelectedValue = "0";
			this.dgvProduct.AutoGenerateColumns = false;
			this.isPostBack = true;
			this.getDetailBalancer("");
		}
		public void searchProducts(DataGridView lv)
		{
			lv.AutoGenerateColumns = false;
			SqlConnection sqlConnection = new SqlConnection(this.objFunc.strConnectionString);
			string str;
			if (this.currGroup != 0)
			{
				str = " AND [GpID] = " + this.currGroup.ToString();
			}
			else
			{
				str = "";
			}
			string str2;
			if (this.txtSearch.Text != "")
			{
				str2 = string.Concat(new string[]
				{
					" AND (Upper(TabProducts.P_Name) LIKE N'%",
					this.txtSearch.Text.ToUpper(),
					"%' OR Upper(TabProducts.NameSearch) LIKE N'%",
					this.txtSearch.Text.ToUpper(),
					"%' ) "
				});
			}
			else
			{
				str2 = " ";
			}
			string cmdText = "SELECT TOP 100 PERCENT 0 AS TT,PID,P_Name,P_PriceBase,P_PriceTrade,P_PriceRetail,UnitName, MinBalance, MaxBalance FROM [TabProducts],[TabUnitProduct] WHERE (Pid IN (SELECT Pid FROM [TabDetailBill])) AND [TabProducts].[P_DonViTinh] = [TabUnitProduct].[UnitID] " + str2 + str + " ORDER BY [P_Name]";
			SqlCommand selectCommand = new SqlCommand(cmdText, sqlConnection);
			SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(selectCommand);
			DataSet dataSet = new DataSet();
			sqlConnection.Open();
			sqlDataAdapter.Fill(dataSet);
			lv.DataSource = dataSet.Tables[0];
			sqlConnection.Close();
			sqlConnection.Dispose();
			sqlDataAdapter.Dispose();
			dataSet.Dispose();
		}
		private void btnClose_Click(object sender, EventArgs e)
		{
			base.Close();
		}
		private void frmInput_KeyDown(object sender, KeyEventArgs e)
		{
			if (e.KeyCode == Keys.Escape)
			{
				base.Close();
			}
		}
		private void cbbParentGID_SelectedIndexChanged(object sender, EventArgs e)
		{
			if (this.cbbParentGID.SelectedValue.ToString() != "0")
			{
				if (this.isPostBack)
				{
					this.currGroup = int.Parse(this.cbbParentGID.SelectedValue.ToString());
				}
				if (this.isPostBack)
				{
					string text = this.cbbWareHouse.SelectedValue.ToString();
					if (text != "0")
					{
						text = " WHERE WID = '" + text + "'";
					}
					else
					{
						text = "WHERE 1 = 1 ";
					}
					this.getDetailBalancer(string.Concat(new string[]
					{
						"SELECT * FROM [TabDetailBill],[TabBill] ",
						text,
						" AND [TabDetailBill].[billID] = [TabBill].[ID] AND [TypeInput] IN ('IN1','IN2','IN3') AND [TabDetailBill].[Pid] IN (SELECT [Pid] FROM [TabProducts] WHERE GpID = ",
						this.cbbParentGID.SelectedValue.ToString(),
						") ORDER BY [ProductName]"
					}));
				}
			}
			else
			{
				this.currGroup = 0;
				if (this.isPostBack)
				{
					this.getDetailBalancer("");
				}
			}
			this.searchProducts(this.dgvRep);
		}
		public void getDetailBalancer(string sqlQuery)
		{
			try
			{
				string text = this.cbbWareHouse.SelectedValue.ToString();
				if (text != "0")
				{
					text = " WHERE WID = '" + text + "'";
				}
				else
				{
					text = "WHERE 1 = 1 ";
				}
				DataTable dataTable = new DataTable();
				DataColumn column = new DataColumn("Pid", typeof(string));
				DataColumn column2 = new DataColumn("ProductName", typeof(string));
				DataColumn column3 = new DataColumn("Packet", typeof(string));
				DataColumn column4 = new DataColumn("PublicPrice", typeof(string));
				DataColumn column5 = new DataColumn("PublicPrice1", typeof(string));
				DataColumn column6 = new DataColumn("PublicPrice2", typeof(string));
				DataColumn column7 = new DataColumn("PublicPrice3", typeof(string));
				dataTable.Columns.Add(column);
				dataTable.Columns.Add(column2);
				dataTable.Columns.Add(column3);
				dataTable.Columns.Add(column4);
				dataTable.Columns.Add(column5);
				dataTable.Columns.Add(column6);
				dataTable.Columns.Add(column7);
				SqlConnection sqlConnection = new SqlConnection(this.sqlCon);
				sqlConnection.Open();
				SqlCommand sqlCommand = sqlConnection.CreateCommand();
				if (sqlQuery == "")
				{
					sqlCommand.CommandText = "SELECT * FROM [TabDetailBill],[TabBill] " + text + " AND [TabDetailBill].[billID] = [TabBill].[ID] AND [TypeInput] IN ('IN1','IN2','IN3') AND [Packet] IN (SELECT [Packet] FROM [TabTotalBalancer] WHERE (productNumberIn > productNumberOut)) ORDER BY [ProductName]";
				}
				else
				{
					sqlCommand.CommandText = sqlQuery;
				}
				SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();
				if (sqlDataReader.HasRows)
				{
					while (sqlDataReader.Read())
					{
						if (!this.checkProductNameInDataGridView(sqlDataReader["ProductName"].ToString(), dataTable))
						{
							try
							{
								dataTable.Rows.Add(new object[]
								{
									sqlDataReader["Pid"].ToString(),
									sqlDataReader["ProductName"].ToString().ToUpper(),
									sqlDataReader["Packet"].ToString(),
									string.Format(Program.lenAffterDecimal, float.Parse(sqlDataReader["PublicPrice"].ToString())),
									string.Format(Program.lenAffterDecimal, float.Parse(sqlDataReader["ProductPrice"].ToString())),
									string.Format(Program.lenAffterDecimal, float.Parse(sqlDataReader["ProductPrice1"].ToString())),
									string.Format(Program.lenAffterDecimal, float.Parse(sqlDataReader["ProductPrice2"].ToString()))
								});
							}
							catch
							{
							}
						}
						else
						{
							try
							{
								dataTable.Rows.Add(new object[]
								{
									sqlDataReader["Pid"].ToString(),
									"",
									sqlDataReader["Packet"].ToString(),
									string.Format(Program.lenAffterDecimal, float.Parse(sqlDataReader["PublicPrice"].ToString())),
									string.Format(Program.lenAffterDecimal, float.Parse(sqlDataReader["ProductPrice"].ToString())),
									string.Format(Program.lenAffterDecimal, float.Parse(sqlDataReader["ProductPrice1"].ToString())),
									string.Format(Program.lenAffterDecimal, float.Parse(sqlDataReader["ProductPrice2"].ToString()))
								});
							}
							catch
							{
							}
						}
					}
				}
				sqlDataReader.Close();
				sqlConnection.Close();
				sqlConnection.Dispose();
				this.objTable = dataTable;
				this.dgvProduct.DataSource = this.objTable;
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message);
				this.objTable = null;
				this.dgvProduct.DataSource = this.objTable;
			}
		}
		private bool checkProductNameInDataGridView(string pName, DataTable objTable)
		{
			bool result = false;
			for (int i = 0; i < objTable.Rows.Count; i++)
			{
				if (objTable.Rows[i]["ProductName"].ToString().ToUpper() == pName.ToUpper())
				{
					result = true;
				}
			}
			return result;
		}
		private void btnSearch_Click(object sender, EventArgs e)
		{
			this.getDetailBalancer("");
		}
		private void resetDataGridView()
		{
			this.objTable = null;
			this.dgvProduct.DataSource = this.objTable;
		}
		private void btnCreate_Click(object sender, EventArgs e)
		{
			for (int i = 0; i < this.dgvProduct.Rows.Count; i++)
			{
				this.updatePrice(this.dgvProduct.Rows[i].Cells["Column9"].Value.ToString(), this.dgvProduct.Rows[i].Cells["Column1"].Value.ToString(), this.dgvProduct.Rows[i].Cells["Column3"].Value.ToString().Replace(",", ""), this.dgvProduct.Rows[i].Cells["Column4"].Value.ToString().Replace(",", ""), this.dgvProduct.Rows[i].Cells["Column5"].Value.ToString().Replace(",", ""), this.dgvProduct.Rows[i].Cells["Column6"].Value.ToString().Replace(",", ""));
			}
			this.btnCreate.Enabled = false;
			this.btnEdit.Enabled = true;
			this.dgvProduct.ReadOnly = true;
			this.dgvProduct.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
		}
		public void updatePrice(string Pid, string Packet, string Price, string productPrice, string productPrice1, string productPrice2)
		{
			try
			{
				SqlConnection sqlConnection = new SqlConnection(this.sqlCon);
				sqlConnection.Open();
				SqlCommand sqlCommand = sqlConnection.CreateCommand();
				sqlCommand.CommandText = string.Concat(new string[]
				{
					"UPDATE [TabDetailBill] SET [PublicPrice] = ",
					Price,
					", [productPrice] = ",
					productPrice,
					", [productPrice1] = ",
					productPrice1,
					", [productPrice2] = ",
					productPrice2,
					" WHERE [Pid] = ",
					Pid,
					" AND [Packet] = '",
					Packet,
					"'"
				});
				sqlCommand.ExecuteNonQuery();
				sqlConnection.Close();
				sqlConnection.Dispose();
			}
			catch
			{
			}
		}
		private void btnEdit_Click(object sender, EventArgs e)
		{
			this.btnCreate.Enabled = true;
			this.btnEdit.Enabled = false;
			this.dgvProduct.ReadOnly = false;
			this.dgvProduct.SelectionMode = DataGridViewSelectionMode.CellSelect;
		}
		private void txtSearch_KeyDown(object sender, KeyEventArgs e)
		{
			if (this.txtSearch.Text != "")
			{
				if (e.KeyCode == Keys.Return)
				{
					if (this.isPostBack)
					{
						string text = this.cbbWareHouse.SelectedValue.ToString();
						if (text != "0")
						{
							text = " WHERE StockID = '" + text + "'";
						}
						else
						{
							text = "WHERE 1 = 1 ";
						}
						this.getDetailBalancer(string.Concat(new string[]
						{
							"SELECT * FROM [TabDetailBill],[TabBill] ",
							text,
							" AND [TabDetailBill].[billID] = [TabBill].[ID] AND [TypeInput] IN ('IN1','IN2','IN3') AND [Packet] IN (SELECT [Packet] FROM [TabTotalBalancer] WHERE (productNumberIn > productNumberOut)) AND [TabDetailBill].[ProductName] LIKE N'%",
							this.txtSearch.Text.ToUpper(),
							"%' ORDER BY [ProductName]"
						}));
					}
				}
			}
		}
		private void dgvRep_CellEnter(object sender, DataGridViewCellEventArgs e)
		{
			if (this.isPostBack && this.ckbProduct.Checked)
			{
				string text = this.cbbWareHouse.SelectedValue.ToString();
				if (text != "0")
				{
					text = " WHERE WID = '" + text + "'";
				}
				else
				{
					text = "WHERE 1 = 1 ";
				}
				this.getDetailBalancer(string.Concat(new string[]
				{
					"SELECT * FROM [TabDetailBill],[TabBill] ",
					text,
					" AND [TabDetailBill].[billID] = [TabBill].[ID] AND [TypeInput] IN ('IN1','IN2','IN3')  AND [Packet] IN (SELECT [Packet] FROM [TabTotalBalancer] WHERE (productNumberIn > productNumberOut)) AND [TabDetailBill].[ProductName] LIKE N'%",
					this.dgvRep.Rows[e.RowIndex].Cells[0].Value.ToString().ToUpper(),
					"%' ORDER BY [ProductName]"
				}));
			}
		}
		private void btnConfig_Click(object sender, EventArgs e)
		{
			frmPriceBaseConfig frmPriceBaseConfig = new frmPriceBaseConfig();
			frmPriceBaseConfig.ShowDialog();
		}
		protected override void Dispose(bool disposing)
		{
			if (disposing && this.components != null)
			{
				this.components.Dispose();
			}
			base.Dispose(disposing);
		}
		private void InitializeComponent()
		{
			DataGridViewCellStyle dataGridViewCellStyle = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle2 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle3 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle4 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle5 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle6 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle7 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle8 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle9 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle10 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle11 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle12 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle13 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle14 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle15 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle16 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle17 = new DataGridViewCellStyle();
			ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(frmActPricePublic));
			this.dgvProduct = new DataGridView();
			this.Column2 = new DataGridViewTextBoxColumn();
			this.Column1 = new DataGridViewTextBoxColumn();
			this.Column9 = new DataGridViewTextBoxColumn();
			this.Column4 = new DataGridViewTextBoxColumn();
			this.Column5 = new DataGridViewTextBoxColumn();
			this.Column6 = new DataGridViewTextBoxColumn();
			this.Column3 = new DataGridViewTextBoxColumn();
			this.btnClose = new Button();
			this.groupBox1 = new GroupBox();
			this.ckbProduct = new CheckBox();
			this.label4 = new Label();
			this.cbbWareHouse = new ComboBox();
			this.dgvRep = new DataGridView();
			this.dg2 = new DataGridViewTextBoxColumn();
			this.dg6 = new DataGridViewTextBoxColumn();
			this.txtSearch = new TextBox();
			this.label3 = new Label();
			this.cbbParentGID = new ComboBox();
			this.label1 = new Label();
			this.btnCreate = new Button();
			this.btnEdit = new Button();
			this.btnConfig = new Button();
			this.dataGridViewTextBoxColumn1 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn2 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn3 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn4 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn5 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn6 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn7 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn8 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn9 = new DataGridViewTextBoxColumn();
			this.label2 = new Label();
			this.label5 = new Label();
			((ISupportInitialize)this.dgvProduct).BeginInit();
			this.groupBox1.SuspendLayout();
			((ISupportInitialize)this.dgvRep).BeginInit();
			base.SuspendLayout();
			this.dgvProduct.AllowUserToAddRows = false;
			this.dgvProduct.AllowUserToDeleteRows = false;
			this.dgvProduct.AllowUserToOrderColumns = true;
			this.dgvProduct.AllowUserToResizeColumns = false;
			this.dgvProduct.AllowUserToResizeRows = false;
			dataGridViewCellStyle.BackColor = Color.FromArgb(192, 255, 255);
			dataGridViewCellStyle.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.dgvProduct.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle;
			this.dgvProduct.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.dgvProduct.BackgroundColor = Color.White;
			this.dgvProduct.BorderStyle = BorderStyle.Fixed3D;
			this.dgvProduct.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
			this.dgvProduct.Columns.AddRange(new DataGridViewColumn[]
			{
				this.Column2,
				this.Column1,
				this.Column9,
				this.Column4,
				this.Column5,
				this.Column6,
				this.Column3
			});
			this.dgvProduct.Cursor = Cursors.Hand;
			this.dgvProduct.EnableHeadersVisualStyles = false;
			this.dgvProduct.Location = new System.Drawing.Point(269, 12);
			this.dgvProduct.MultiSelect = false;
			this.dgvProduct.Name = "dgvProduct";
			this.dgvProduct.ReadOnly = true;
			this.dgvProduct.RowHeadersVisible = false;
			this.dgvProduct.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing;
			this.dgvProduct.RowTemplate.DefaultCellStyle.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.dgvProduct.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
			this.dgvProduct.Size = new Size(624, 543);
			this.dgvProduct.TabIndex = 1;
			this.Column2.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
			this.Column2.DataPropertyName = "productName";
			this.Column2.HeaderText = "Sản phẩm";
			this.Column2.MinimumWidth = 100;
			this.Column2.Name = "Column2";
			this.Column2.ReadOnly = true;
			this.Column2.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.Column1.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column1.DataPropertyName = "Packet";
			dataGridViewCellStyle2.Font = new Font("Arial", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 0);
			this.Column1.DefaultCellStyle = dataGridViewCellStyle2;
			this.Column1.HeaderText = "Số lô";
			this.Column1.MinimumWidth = 120;
			this.Column1.Name = "Column1";
			this.Column1.ReadOnly = true;
			this.Column1.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.Column1.Width = 120;
			this.Column9.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column9.DataPropertyName = "Pid";
			this.Column9.HeaderText = "Mã sản phẩm";
			this.Column9.Name = "Column9";
			this.Column9.ReadOnly = true;
			this.Column9.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.Column9.Visible = false;
			this.Column4.DataPropertyName = "PublicPrice1";
			dataGridViewCellStyle3.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle3.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle3.ForeColor = Color.Red;
			this.Column4.DefaultCellStyle = dataGridViewCellStyle3;
			this.Column4.HeaderText = "Giá nhập";
			this.Column4.MinimumWidth = 100;
			this.Column4.Name = "Column4";
			this.Column4.ReadOnly = true;
			this.Column4.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.Column5.DataPropertyName = "PublicPrice2";
			dataGridViewCellStyle4.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle4.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle4.ForeColor = Color.Blue;
			this.Column5.DefaultCellStyle = dataGridViewCellStyle4;
			this.Column5.HeaderText = "Giá buôn";
			this.Column5.MinimumWidth = 100;
			this.Column5.Name = "Column5";
			this.Column5.ReadOnly = true;
			this.Column5.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.Column6.DataPropertyName = "PublicPrice3";
			dataGridViewCellStyle5.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle5.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle5.ForeColor = Color.Blue;
			this.Column6.DefaultCellStyle = dataGridViewCellStyle5;
			this.Column6.HeaderText = "Giá lẻ";
			this.Column6.MinimumWidth = 100;
			this.Column6.Name = "Column6";
			this.Column6.ReadOnly = true;
			this.Column6.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.Column3.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column3.DataPropertyName = "PublicPrice";
			dataGridViewCellStyle6.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle6.Font = new Font("Arial", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 0);
			dataGridViewCellStyle6.ForeColor = Color.Blue;
			this.Column3.DefaultCellStyle = dataGridViewCellStyle6;
			this.Column3.HeaderText = "Giá niêm yết";
			this.Column3.MinimumWidth = 100;
			this.Column3.Name = "Column3";
			this.Column3.ReadOnly = true;
			this.Column3.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.btnClose.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right);
			this.btnClose.FlatAppearance.BorderColor = Color.FromArgb(255, 128, 255);
			this.btnClose.FlatStyle = FlatStyle.Flat;
			this.btnClose.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnClose.Location = new System.Drawing.Point(788, 563);
			this.btnClose.Name = "btnClose";
			this.btnClose.Size = new Size(100, 26);
			this.btnClose.TabIndex = 38;
			this.btnClose.Text = "Thoát  [ ESC ]";
			this.btnClose.UseVisualStyleBackColor = true;
			this.btnClose.Click += new EventHandler(this.btnClose_Click);
			this.groupBox1.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left);
			this.groupBox1.Controls.Add(this.ckbProduct);
			this.groupBox1.Controls.Add(this.label4);
			this.groupBox1.Controls.Add(this.cbbWareHouse);
			this.groupBox1.Controls.Add(this.dgvRep);
			this.groupBox1.Controls.Add(this.txtSearch);
			this.groupBox1.Controls.Add(this.label3);
			this.groupBox1.Controls.Add(this.cbbParentGID);
			this.groupBox1.Controls.Add(this.label1);
			this.groupBox1.Controls.Add(this.label2);
			this.groupBox1.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.groupBox1.Location = new System.Drawing.Point(7, 5);
			this.groupBox1.Name = "groupBox1";
			this.groupBox1.Size = new Size(256, 589);
			this.groupBox1.TabIndex = 39;
			this.groupBox1.TabStop = false;
			this.groupBox1.Text = "Điều kiện tìm kiếm";
			this.ckbProduct.BackColor = SystemColors.ControlLight;
			this.ckbProduct.Location = new System.Drawing.Point(14, 181);
			this.ckbProduct.Name = "ckbProduct";
			this.ckbProduct.Size = new Size(231, 23);
			this.ckbProduct.TabIndex = 96;
			this.ckbProduct.Text = "Xem theo sản phẩm";
			this.ckbProduct.UseVisualStyleBackColor = false;
			this.label4.BackColor = SystemColors.ControlLight;
			this.label4.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.label4.Location = new System.Drawing.Point(10, 20);
			this.label4.Name = "label4";
			this.label4.Size = new Size(235, 22);
			this.label4.TabIndex = 94;
			this.label4.Text = "Kho hàng";
			this.label4.TextAlign = ContentAlignment.MiddleCenter;
			this.cbbWareHouse.Cursor = Cursors.Hand;
			this.cbbWareHouse.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbWareHouse.FlatStyle = FlatStyle.Flat;
			this.cbbWareHouse.Font = new Font("Arial", 8.5f, FontStyle.Bold);
			this.cbbWareHouse.FormattingEnabled = true;
			this.cbbWareHouse.Location = new System.Drawing.Point(10, 42);
			this.cbbWareHouse.Name = "cbbWareHouse";
			this.cbbWareHouse.Size = new Size(235, 22);
			this.cbbWareHouse.TabIndex = 93;
			this.dgvRep.AllowUserToAddRows = false;
			this.dgvRep.AllowUserToDeleteRows = false;
			this.dgvRep.AllowUserToResizeColumns = false;
			this.dgvRep.AllowUserToResizeRows = false;
			dataGridViewCellStyle7.BackColor = Color.FromArgb(192, 255, 255);
			dataGridViewCellStyle7.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.dgvRep.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle7;
			this.dgvRep.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left);
			this.dgvRep.BackgroundColor = Color.White;
			this.dgvRep.BorderStyle = BorderStyle.Fixed3D;
			this.dgvRep.CellBorderStyle = DataGridViewCellBorderStyle.Raised;
			this.dgvRep.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.None;
			dataGridViewCellStyle8.BackColor = SystemColors.Control;
			dataGridViewCellStyle8.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			dataGridViewCellStyle8.ForeColor = SystemColors.WindowText;
			dataGridViewCellStyle8.SelectionBackColor = Color.Aqua;
			dataGridViewCellStyle8.SelectionForeColor = Color.Black;
			this.dgvRep.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle8;
			this.dgvRep.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
			this.dgvRep.ColumnHeadersVisible = false;
			this.dgvRep.Columns.AddRange(new DataGridViewColumn[]
			{
				this.dg2,
				this.dg6
			});
			this.dgvRep.Cursor = Cursors.Hand;
			this.dgvRep.EnableHeadersVisualStyles = false;
			this.dgvRep.Location = new System.Drawing.Point(10, 204);
			this.dgvRep.MultiSelect = false;
			this.dgvRep.Name = "dgvRep";
			this.dgvRep.ReadOnly = true;
			dataGridViewCellStyle9.BackColor = SystemColors.Control;
			dataGridViewCellStyle9.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			dataGridViewCellStyle9.ForeColor = Color.Black;
			dataGridViewCellStyle9.SelectionBackColor = Color.Aqua;
			dataGridViewCellStyle9.SelectionForeColor = Color.Black;
			this.dgvRep.RowHeadersDefaultCellStyle = dataGridViewCellStyle9;
			this.dgvRep.RowHeadersVisible = false;
			this.dgvRep.RowHeadersWidth = 26;
			this.dgvRep.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing;
			dataGridViewCellStyle10.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.dgvRep.RowsDefaultCellStyle = dataGridViewCellStyle10;
			this.dgvRep.RowTemplate.DefaultCellStyle.BackColor = Color.White;
			this.dgvRep.RowTemplate.DefaultCellStyle.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.dgvRep.RowTemplate.DefaultCellStyle.ForeColor = Color.Black;
			this.dgvRep.RowTemplate.DefaultCellStyle.SelectionBackColor = Color.Aqua;
			this.dgvRep.RowTemplate.DefaultCellStyle.SelectionForeColor = Color.Black;
			this.dgvRep.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
			this.dgvRep.Size = new Size(235, 376);
			this.dgvRep.TabIndex = 54;
			this.dgvRep.CellEnter += new DataGridViewCellEventHandler(this.dgvRep_CellEnter);
			this.dg2.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
			this.dg2.DataPropertyName = "P_Name";
			dataGridViewCellStyle11.Alignment = DataGridViewContentAlignment.MiddleLeft;
			dataGridViewCellStyle11.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle11.NullValue = null;
			this.dg2.DefaultCellStyle = dataGridViewCellStyle11;
			this.dg2.HeaderText = "Tên sản phẩm";
			this.dg2.MinimumWidth = 120;
			this.dg2.Name = "dg2";
			this.dg2.ReadOnly = true;
			this.dg6.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dg6.DataPropertyName = "PID";
			this.dg6.HeaderText = "PID";
			this.dg6.Name = "dg6";
			this.dg6.ReadOnly = true;
			this.dg6.Resizable = DataGridViewTriState.False;
			this.dg6.Visible = false;
			this.dg6.Width = 5;
			this.txtSearch.BackColor = Color.White;
			this.txtSearch.Font = new Font("Arial", 11.25f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.txtSearch.Location = new System.Drawing.Point(10, 147);
			this.txtSearch.Name = "txtSearch";
			this.txtSearch.Size = new Size(235, 25);
			this.txtSearch.TabIndex = 53;
			this.txtSearch.KeyDown += new KeyEventHandler(this.txtSearch_KeyDown);
			this.label3.BackColor = SystemColors.ControlLight;
			this.label3.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.label3.Location = new System.Drawing.Point(10, 124);
			this.label3.Name = "label3";
			this.label3.Size = new Size(235, 23);
			this.label3.TabIndex = 52;
			this.label3.Text = "Tìm theo tên thuốc - vật tư";
			this.label3.TextAlign = ContentAlignment.MiddleCenter;
			this.cbbParentGID.BackColor = Color.FromArgb(255, 192, 255);
			this.cbbParentGID.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbParentGID.FlatStyle = FlatStyle.Flat;
			this.cbbParentGID.Font = new Font("Arial", 8.5f, FontStyle.Bold);
			this.cbbParentGID.FormattingEnabled = true;
			this.cbbParentGID.Location = new System.Drawing.Point(10, 94);
			this.cbbParentGID.Name = "cbbParentGID";
			this.cbbParentGID.Size = new Size(235, 22);
			this.cbbParentGID.TabIndex = 40;
			this.cbbParentGID.SelectedIndexChanged += new EventHandler(this.cbbParentGID_SelectedIndexChanged);
			this.cbbParentGID.SelectedValueChanged += new EventHandler(this.cbbParentGID_SelectedIndexChanged);
			this.label1.BackColor = SystemColors.ControlLight;
			this.label1.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.label1.Location = new System.Drawing.Point(10, 72);
			this.label1.Name = "label1";
			this.label1.Size = new Size(235, 22);
			this.label1.TabIndex = 41;
			this.label1.Text = "Thuốc  - vật tư";
			this.label1.TextAlign = ContentAlignment.MiddleCenter;
			this.btnCreate.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.btnCreate.Enabled = false;
			this.btnCreate.FlatAppearance.BorderColor = Color.FromArgb(255, 128, 255);
			this.btnCreate.FlatStyle = FlatStyle.Flat;
			this.btnCreate.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnCreate.Location = new System.Drawing.Point(496, 563);
			this.btnCreate.Name = "btnCreate";
			this.btnCreate.Size = new Size(114, 26);
			this.btnCreate.TabIndex = 42;
			this.btnCreate.Text = "Lưu giá niêm yết";
			this.btnCreate.UseVisualStyleBackColor = true;
			this.btnCreate.Click += new EventHandler(this.btnCreate_Click);
			this.btnEdit.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.btnEdit.FlatAppearance.BorderColor = Color.FromArgb(255, 128, 255);
			this.btnEdit.FlatStyle = FlatStyle.Flat;
			this.btnEdit.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnEdit.Location = new System.Drawing.Point(387, 563);
			this.btnEdit.Name = "btnEdit";
			this.btnEdit.Size = new Size(105, 26);
			this.btnEdit.TabIndex = 49;
			this.btnEdit.Text = "Cập nhật  [ F5 ]";
			this.btnEdit.UseVisualStyleBackColor = true;
			this.btnEdit.Click += new EventHandler(this.btnEdit_Click);
			this.btnConfig.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.btnConfig.FlatAppearance.BorderColor = Color.FromArgb(255, 128, 255);
			this.btnConfig.FlatStyle = FlatStyle.Flat;
			this.btnConfig.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnConfig.Location = new System.Drawing.Point(274, 563);
			this.btnConfig.Name = "btnConfig";
			this.btnConfig.Size = new Size(109, 26);
			this.btnConfig.TabIndex = 50;
			this.btnConfig.Text = "Cấu hình chung";
			this.btnConfig.UseVisualStyleBackColor = true;
			this.btnConfig.Click += new EventHandler(this.btnConfig_Click);
			this.dataGridViewTextBoxColumn1.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
			this.dataGridViewTextBoxColumn1.DataPropertyName = "P_Name";
			dataGridViewCellStyle12.Alignment = DataGridViewContentAlignment.MiddleLeft;
			dataGridViewCellStyle12.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle12.NullValue = null;
			this.dataGridViewTextBoxColumn1.DefaultCellStyle = dataGridViewCellStyle12;
			this.dataGridViewTextBoxColumn1.HeaderText = "Tên sản phẩm";
			this.dataGridViewTextBoxColumn1.MinimumWidth = 120;
			this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
			this.dataGridViewTextBoxColumn2.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn2.DataPropertyName = "PID";
			this.dataGridViewTextBoxColumn2.HeaderText = "PID";
			this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
			this.dataGridViewTextBoxColumn2.Resizable = DataGridViewTriState.False;
			this.dataGridViewTextBoxColumn2.Visible = false;
			this.dataGridViewTextBoxColumn2.Width = 5;
			this.dataGridViewTextBoxColumn3.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
			this.dataGridViewTextBoxColumn3.DataPropertyName = "productName";
			this.dataGridViewTextBoxColumn3.HeaderText = "Sản phẩm";
			this.dataGridViewTextBoxColumn3.MinimumWidth = 100;
			this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
			this.dataGridViewTextBoxColumn3.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.dataGridViewTextBoxColumn4.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn4.DataPropertyName = "Packet";
			dataGridViewCellStyle13.Font = new Font("Arial", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 0);
			this.dataGridViewTextBoxColumn4.DefaultCellStyle = dataGridViewCellStyle13;
			this.dataGridViewTextBoxColumn4.HeaderText = "Số lô";
			this.dataGridViewTextBoxColumn4.MinimumWidth = 120;
			this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
			this.dataGridViewTextBoxColumn4.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.dataGridViewTextBoxColumn4.Width = 120;
			this.dataGridViewTextBoxColumn5.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn5.DataPropertyName = "Pid";
			this.dataGridViewTextBoxColumn5.HeaderText = "Mã sản phẩm";
			this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5";
			this.dataGridViewTextBoxColumn5.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.dataGridViewTextBoxColumn5.Visible = false;
			this.dataGridViewTextBoxColumn6.DataPropertyName = "PublicPrice1";
			dataGridViewCellStyle14.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle14.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle14.ForeColor = Color.Red;
			this.dataGridViewTextBoxColumn6.DefaultCellStyle = dataGridViewCellStyle14;
			this.dataGridViewTextBoxColumn6.HeaderText = "Giá nhập";
			this.dataGridViewTextBoxColumn6.MinimumWidth = 100;
			this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
			this.dataGridViewTextBoxColumn6.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.dataGridViewTextBoxColumn7.DataPropertyName = "PublicPrice2";
			dataGridViewCellStyle15.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle15.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle15.ForeColor = Color.Blue;
			this.dataGridViewTextBoxColumn7.DefaultCellStyle = dataGridViewCellStyle15;
			this.dataGridViewTextBoxColumn7.HeaderText = "Giá buôn";
			this.dataGridViewTextBoxColumn7.MinimumWidth = 100;
			this.dataGridViewTextBoxColumn7.Name = "dataGridViewTextBoxColumn7";
			this.dataGridViewTextBoxColumn7.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.dataGridViewTextBoxColumn8.DataPropertyName = "PublicPrice3";
			dataGridViewCellStyle16.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle16.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle16.ForeColor = Color.Blue;
			this.dataGridViewTextBoxColumn8.DefaultCellStyle = dataGridViewCellStyle16;
			this.dataGridViewTextBoxColumn8.HeaderText = "Giá lẻ";
			this.dataGridViewTextBoxColumn8.MinimumWidth = 100;
			this.dataGridViewTextBoxColumn8.Name = "dataGridViewTextBoxColumn8";
			this.dataGridViewTextBoxColumn8.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.dataGridViewTextBoxColumn9.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn9.DataPropertyName = "PublicPrice";
			dataGridViewCellStyle17.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle17.Font = new Font("Arial", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 0);
			dataGridViewCellStyle17.ForeColor = Color.Blue;
			this.dataGridViewTextBoxColumn9.DefaultCellStyle = dataGridViewCellStyle17;
			this.dataGridViewTextBoxColumn9.HeaderText = "Giá niêm yết";
			this.dataGridViewTextBoxColumn9.MinimumWidth = 100;
			this.dataGridViewTextBoxColumn9.Name = "dataGridViewTextBoxColumn9";
			this.dataGridViewTextBoxColumn9.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.label2.BackColor = SystemColors.ControlLight;
			this.label2.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.label2.Location = new System.Drawing.Point(10, 181);
			this.label2.Name = "label2";
			this.label2.Size = new Size(192, 23);
			this.label2.TabIndex = 97;
			this.label2.TextAlign = ContentAlignment.MiddleCenter;
			this.label5.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.label5.BackColor = Color.White;
			this.label5.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.label5.Location = new System.Drawing.Point(269, 558);
			this.label5.Name = "label5";
			this.label5.Size = new Size(624, 36);
			this.label5.TabIndex = 98;
			this.label5.TextAlign = ContentAlignment.MiddleCenter;
			base.AutoScaleDimensions = new SizeF(7f, 15f);
			//base.AutoScaleMode = AutoScaleMode.Font;
			base.ClientSize = new Size(900, 600);
			base.Controls.Add(this.btnConfig);
			base.Controls.Add(this.btnEdit);
			base.Controls.Add(this.btnCreate);
			base.Controls.Add(this.btnClose);
			base.Controls.Add(this.dgvProduct);
			base.Controls.Add(this.groupBox1);
			base.Controls.Add(this.label5);
			this.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			//base.Icon = (System.Drawing.Icon)componentResourceManager.GetObject("$this.Icon");
			//base.Icon = (Icon)componentResourceManager.GetObject("$this.Icon");
			base.KeyPreview = true;
			base.Name = "frmActPricePublic";
			base.ShowInTaskbar = false;
			base.StartPosition = FormStartPosition.CenterScreen;
			this.Text = "NIÊM YẾT GIÁ";
			base.WindowState = FormWindowState.Maximized;
			base.Load += new EventHandler(this.frmInput_Load);
			base.KeyDown += new KeyEventHandler(this.frmInput_KeyDown);
			((ISupportInitialize)this.dgvProduct).EndInit();
			this.groupBox1.ResumeLayout(false);
			this.groupBox1.PerformLayout();
			((ISupportInitialize)this.dgvRep).EndInit();
			base.ResumeLayout(false);
		}
	}
}
